package com.javadaemon.rpgengine.model;


public class TeleportTile extends Tile {
    
    private int destTileX; // The destination tile X. 
    private int destTileY; // destination tile Y.
    private String destMapID; // destination mapID

    public TeleportTile(TILE_TYPE type, int destX, int destY, String mapID) {
	super(type);
	
	this.destTileX = destX;
	this.destTileY = destY;
	this.destMapID = mapID;
    }
    
    public void onApproach(Actor actor, TileMap map) {
	map.getTile(actor.getTileX(), actor.getTileY()).setActor(null);
	actor.setMap(destMapID);
	actor.setTileX(destTileX);
	actor.setTileY(destTileY);
	actor.setTileNeed(true); // Next update will put the actor on the right tile
    }
}
